Next | Prev | Up | Top | Contents | Index

How to Use Interlace and Copy Texture Together

One application of the interlace extension is to use it together with the copy texture extension: You can use glCopyTexSubImage2DEXT() to copy the contents of the video field to texture memory and end up with de-interlaced video.

You can interlace pixels from two images as follows:

glEnable(GL_INTERLACE_SGIX);      
< set current raster position to (xr,yr) >
glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, I0);  
< set raster position to (xr,yr+zoomy) >
glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, I1);
This process is equivalent to taking pixel rows (0,2,4,...) of I2 are from image I0, and rows (1,3,5,...) from image I1, as follows:

glDisable( GL_INTERLACE_SGIX);  
< set current raster position to (xr,yr)>
glDrawPixels(width, 2*height, GL_RGBA, GL_UNSIGNED_BYTE, I2);

Next | Prev | Up | Top | Contents | Index